<template>
  <div>
    <div class="Reg_log_style">
      <div class="logo">
        <a href="#"><img src="static/images/logo.png" /></a>
      </div>

      <div class="login_style">
        <div class="left_img"><img src="static/images/bg_name_03.png" /></div>
        <div class="right_img"><img src="static/images/bg_name_05.png" /></div>

        <form id="myform" class="sign_area" autocomplete="off">
          <div class="title_name">
            <span>登录</span>
          </div>

          <div class="login_m_1">

            <div class="add_login">
              <ul>
                <li class="frame_style " :class="{ 'form_errors':isusernameselected }">
                  <label class="user_icon"></label>
                  <input name="" type="text" id="user_text" placeholder="用户名/邮箱" @focus="changeUsernameStyle()" @blur="changeUsernameStyle()" />
                </li>
                <li class="frame_style" :class="{ 'form_errors':isuserpwdselected }">
                  <label class="password_icon"></label>
                  <input name="" type="password" id="tbPassword" placeholder="密码" @focus="changeUpwdtStyle()" @blur="changeUpwdtStyle()" />
                </li>
              </ul>

              <div class="auto_login clearfix">
                <p class="clearfix">
                  <input type="checkbox" name="自动登入" id="check_agreement" class="check_agreement">自动登录
                  <!-- <a id="check_agreement" href="#" class="check_agreement">自动登录</a> -->
                  <input id="autoLoginCheck" type="hidden">
                  <span id="agreement_tips" class="auto_tips" style="">请勿在公用电脑上启用</span>
                </p>
                <a href="#" target="_blank" class="forget_pswd" tabindex="-1">忘记密码？</a>
              </div>
              <div class="center clearfix">
                <a class="btn_pink" id="btn_signin" href="javascript:void(0)" @click="onLoginButtonClicked">立即登录</a>
              </div>

            </div>

            <!--其他登录方式-->
            <div class="Login_Method">
              <div class="title">
                <span>第三方登录方式</span>
              </div>

              <div>
                <a href="#"><img src="static/images/l_1.png" /></a>
                <a href="#"><img src="static/images/l_2.png" /></a>
                <a href="#"><img src="static/images/l_4.png" /></a>
              </div>

            </div>
          </div>

        </form>

      </div>

    </div>
    <div class="btmbg">
      <div class="btm">
        备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com Copyright © 2015-2018 商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group
        <br>
      </div>
    </div>
  </div>
</template>

<script>
import { onLogin} from '../api/user'
import  http from '../api/index'

export default {
  data() {
    return {
      isusernameselected: false,
      isuserpwdselected: false,
      username:'',
      upwd:''
    };
  },
  methods: {
    changeUsernameStyle() {
      this.isusernameselected = !this.isusernameselected;
    },
    changeUpwdtStyle() {
      this.isuserpwdselected = !this.isuserpwdselected;
    },
    onLoginButtonClicked()
    {
      //TODO Login
      // onLogin({username: this.username, "upwd":this.upwd}).then(res => {
      //   console.log(res);
      // })

      http.fetchGet('/api/getnewsinfo').then(res => {
        console.log(res);
      })

     
    }
  }
};
</script>

<style>
</style>
